Optimal. Leaf size=133 \[ \frac {a x}{a^2+b^2}+\frac {\left (a^2-b^2\right ) \cot (c+d x)}{a^3 d}+\frac {b \cot ^2(c+d x)}{2 a^2 d}-\frac {\cot ^3(c+d x)}{3 a d}+\frac {b \left (a^2-b^2\right ) \log (\sin (c+d x))}{a^4 d}+\frac {b^5 \log (a \cos (c+d x)+b \sin (c+d x))}{a^4 \left (a^2+b^2\right ) d} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.34, antiderivative size = 133, normalized size of antiderivative = 1.00, number of steps
used = 6, number of rules used = 6, integrand size = 21, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.286, Rules used = {3650, 3730,
3731, 3732, 3611, 3556} \begin {gather*} \frac {a x}{a^2+b^2}+\frac {b \cot ^2(c+d x)}{2 a^2 d}+\frac {b \left (a^2-b^2\right ) \log (\sin (c+d x))}{a^4 d}+\frac {b^5 \log (a \cos (c+d x)+b \sin (c+d x))}{a^4 d \left (a^2+b^2\right )}+\frac {\left (a^2-b^2\right ) \cot (c+d x)}{a^3 d}-\frac {\cot ^3(c+d x)}{3 a d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 3556
Rule 3611
Rule 3650
Rule 3730
Rule 3731
Rule 3732
Rubi steps
\begin {align*} \int \frac {\cot ^4(c+d x)}{a+b \tan (c+d x)} \, dx &=-\frac {\cot ^3(c+d x)}{3 a d}-\frac {\int \frac {\cot ^3(c+d x) \left (3 b+3 a \tan (c+d x)+3 b \tan ^2(c+d x)\right )}{a+b \tan (c+d x)} \, dx}{3 a}\\ &=\frac {b \cot ^2(c+d x)}{2 a^2 d}-\frac {\cot ^3(c+d x)}{3 a d}+\frac {\int \frac {\cot ^2(c+d x) \left (-6 \left (a^2-b^2\right )+6 b^2 \tan ^2(c+d x)\right )}{a+b \tan (c+d x)} \, dx}{6 a^2}\\ &=\frac {\left (a^2-b^2\right ) \cot (c+d x)}{a^3 d}+\frac {b \cot ^2(c+d x)}{2 a^2 d}-\frac {\cot ^3(c+d x)}{3 a d}-\frac {\int \frac {\cot (c+d x) \left (-6 b \left (a^2-b^2\right )-6 a^3 \tan (c+d x)-6 b \left (a^2-b^2\right ) \tan ^2(c+d x)\right )}{a+b \tan (c+d x)} \, dx}{6 a^3}\\ &=\frac {a x}{a^2+b^2}+\frac {\left (a^2-b^2\right ) \cot (c+d x)}{a^3 d}+\frac {b \cot ^2(c+d x)}{2 a^2 d}-\frac {\cot ^3(c+d x)}{3 a d}+\frac {\left (b \left (a^2-b^2\right )\right ) \int \cot (c+d x) \, dx}{a^4}+\frac {b^5 \int \frac {b-a \tan (c+d x)}{a+b \tan (c+d x)} \, dx}{a^4 \left (a^2+b^2\right )}\\ &=\frac {a x}{a^2+b^2}+\frac {\left (a^2-b^2\right ) \cot (c+d x)}{a^3 d}+\frac {b \cot ^2(c+d x)}{2 a^2 d}-\frac {\cot ^3(c+d x)}{3 a d}+\frac {b \left (a^2-b^2\right ) \log (\sin (c+d x))}{a^4 d}+\frac {b^5 \log (a \cos (c+d x)+b \sin (c+d x))}{a^4 \left (a^2+b^2\right ) d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [C] Result contains complex when optimal does not.
time = 1.79, size = 131, normalized size = 0.98 \begin {gather*} -\frac {-\frac {6 \left (a^2-b^2\right ) \cot (c+d x)}{a^3}-\frac {3 b \cot ^2(c+d x)}{a^2}+\frac {2 \cot ^3(c+d x)}{a}+\frac {3 \log (i-\cot (c+d x))}{i a+b}+\frac {3 i \log (i+\cot (c+d x))}{a+i b}-\frac {6 b^5 \log (b+a \cot (c+d x))}{a^4 \left (a^2+b^2\right )}}{6 d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.29, size = 137, normalized size = 1.03
method | result | size |
derivativedivides | \(\frac {-\frac {1}{3 a \tan \left (d x +c \right )^{3}}-\frac {-a^{2}+b^{2}}{a^{3} \tan \left (d x +c \right )}+\frac {\left (a^{2}-b^{2}\right ) b \ln \left (\tan \left (d x +c \right )\right )}{a^{4}}+\frac {b}{2 a^{2} \tan \left (d x +c \right )^{2}}+\frac {b^{5} \ln \left (a +b \tan \left (d x +c \right )\right )}{\left (a^{2}+b^{2}\right ) a^{4}}+\frac {-\frac {b \ln \left (1+\tan ^{2}\left (d x +c \right )\right )}{2}+a \arctan \left (\tan \left (d x +c \right )\right )}{a^{2}+b^{2}}}{d}\) | \(137\) |
default | \(\frac {-\frac {1}{3 a \tan \left (d x +c \right )^{3}}-\frac {-a^{2}+b^{2}}{a^{3} \tan \left (d x +c \right )}+\frac {\left (a^{2}-b^{2}\right ) b \ln \left (\tan \left (d x +c \right )\right )}{a^{4}}+\frac {b}{2 a^{2} \tan \left (d x +c \right )^{2}}+\frac {b^{5} \ln \left (a +b \tan \left (d x +c \right )\right )}{\left (a^{2}+b^{2}\right ) a^{4}}+\frac {-\frac {b \ln \left (1+\tan ^{2}\left (d x +c \right )\right )}{2}+a \arctan \left (\tan \left (d x +c \right )\right )}{a^{2}+b^{2}}}{d}\) | \(137\) |
norman | \(\frac {\frac {a x \left (\tan ^{3}\left (d x +c \right )\right )}{a^{2}+b^{2}}+\frac {\left (a^{2}-b^{2}\right ) \left (\tan ^{2}\left (d x +c \right )\right )}{a^{3} d}-\frac {1}{3 d a}+\frac {b \tan \left (d x +c \right )}{2 a^{2} d}}{\tan \left (d x +c \right )^{3}}+\frac {b^{5} \ln \left (a +b \tan \left (d x +c \right )\right )}{\left (a^{2}+b^{2}\right ) a^{4} d}+\frac {\left (a^{2}-b^{2}\right ) b \ln \left (\tan \left (d x +c \right )\right )}{a^{4} d}-\frac {b \ln \left (1+\tan ^{2}\left (d x +c \right )\right )}{2 d \left (a^{2}+b^{2}\right )}\) | \(159\) |
risch | \(-\frac {x}{i b -a}-\frac {2 i b x}{a^{2}}-\frac {2 i b c}{a^{2} d}+\frac {2 i b^{3} x}{a^{4}}+\frac {2 i b^{3} c}{a^{4} d}-\frac {2 i b^{5} x}{\left (a^{2}+b^{2}\right ) a^{4}}-\frac {2 i b^{5} c}{\left (a^{2}+b^{2}\right ) a^{4} d}-\frac {2 i \left (-3 i a b \,{\mathrm e}^{4 i \left (d x +c \right )}-6 a^{2} {\mathrm e}^{4 i \left (d x +c \right )}+3 b^{2} {\mathrm e}^{4 i \left (d x +c \right )}+3 i a b \,{\mathrm e}^{2 i \left (d x +c \right )}+6 a^{2} {\mathrm e}^{2 i \left (d x +c \right )}-6 b^{2} {\mathrm e}^{2 i \left (d x +c \right )}-4 a^{2}+3 b^{2}\right )}{3 d \,a^{3} \left ({\mathrm e}^{2 i \left (d x +c \right )}-1\right )^{3}}+\frac {b \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}-1\right )}{a^{2} d}-\frac {b^{3} \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}-1\right )}{a^{4} d}+\frac {b^{5} \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}-\frac {i b +a}{i b -a}\right )}{\left (a^{2}+b^{2}\right ) a^{4} d}\) | \(306\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 1.02, size = 145, normalized size = 1.09 \begin {gather*} \frac {\frac {6 \, b^{5} \log \left (b \tan \left (d x + c\right ) + a\right )}{a^{6} + a^{4} b^{2}} + \frac {6 \, {\left (d x + c\right )} a}{a^{2} + b^{2}} - \frac {3 \, b \log \left (\tan \left (d x + c\right )^{2} + 1\right )}{a^{2} + b^{2}} + \frac {6 \, {\left (a^{2} b - b^{3}\right )} \log \left (\tan \left (d x + c\right )\right )}{a^{4}} + \frac {3 \, a b \tan \left (d x + c\right ) + 6 \, {\left (a^{2} - b^{2}\right )} \tan \left (d x + c\right )^{2} - 2 \, a^{2}}{a^{3} \tan \left (d x + c\right )^{3}}}{6 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 1.83, size = 207, normalized size = 1.56 \begin {gather*} \frac {3 \, b^{5} \log \left (\frac {b^{2} \tan \left (d x + c\right )^{2} + 2 \, a b \tan \left (d x + c\right ) + a^{2}}{\tan \left (d x + c\right )^{2} + 1}\right ) \tan \left (d x + c\right )^{3} - 2 \, a^{5} - 2 \, a^{3} b^{2} + 3 \, {\left (a^{4} b - b^{5}\right )} \log \left (\frac {\tan \left (d x + c\right )^{2}}{\tan \left (d x + c\right )^{2} + 1}\right ) \tan \left (d x + c\right )^{3} + 3 \, {\left (2 \, a^{5} d x + a^{4} b + a^{2} b^{3}\right )} \tan \left (d x + c\right )^{3} + 6 \, {\left (a^{5} - a b^{4}\right )} \tan \left (d x + c\right )^{2} + 3 \, {\left (a^{4} b + a^{2} b^{3}\right )} \tan \left (d x + c\right )}{6 \, {\left (a^{6} + a^{4} b^{2}\right )} d \tan \left (d x + c\right )^{3}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [C] Result contains complex when optimal does not.
time = 3.24, size = 1533, normalized size = 11.53 \begin {gather*} \text {Too large to display} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.79, size = 187, normalized size = 1.41 \begin {gather*} \frac {\frac {6 \, b^{6} \log \left ({\left | b \tan \left (d x + c\right ) + a \right |}\right )}{a^{6} b + a^{4} b^{3}} + \frac {6 \, {\left (d x + c\right )} a}{a^{2} + b^{2}} - \frac {3 \, b \log \left (\tan \left (d x + c\right )^{2} + 1\right )}{a^{2} + b^{2}} + \frac {6 \, {\left (a^{2} b - b^{3}\right )} \log \left ({\left | \tan \left (d x + c\right ) \right |}\right )}{a^{4}} - \frac {11 \, a^{2} b \tan \left (d x + c\right )^{3} - 11 \, b^{3} \tan \left (d x + c\right )^{3} - 6 \, a^{3} \tan \left (d x + c\right )^{2} + 6 \, a b^{2} \tan \left (d x + c\right )^{2} - 3 \, a^{2} b \tan \left (d x + c\right ) + 2 \, a^{3}}{a^{4} \tan \left (d x + c\right )^{3}}}{6 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 4.26, size = 153, normalized size = 1.15 \begin {gather*} \frac {{\mathrm {cot}\left (c+d\,x\right )}^3\,\left (\frac {{\mathrm {tan}\left (c+d\,x\right )}^2\,\left (a^2-b^2\right )}{a^3}-\frac {1}{3\,a}+\frac {b\,\mathrm {tan}\left (c+d\,x\right )}{2\,a^2}\right )}{d}-\frac {\ln \left (\mathrm {tan}\left (c+d\,x\right )+1{}\mathrm {i}\right )}{2\,d\,\left (b+a\,1{}\mathrm {i}\right )}+\frac {b^5\,\ln \left (a+b\,\mathrm {tan}\left (c+d\,x\right )\right )}{a^4\,d\,\left (a^2+b^2\right )}+\frac {b\,\ln \left (\mathrm {tan}\left (c+d\,x\right )\right )\,\left (a^2-b^2\right )}{a^4\,d}-\frac {\ln \left (\mathrm {tan}\left (c+d\,x\right )-\mathrm {i}\right )\,1{}\mathrm {i}}{2\,d\,\left (a+b\,1{}\mathrm {i}\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________